(hscroll_window_tree): Position cursor near to right margin in hscrolled
authorKim F. Storm <storm@cua.dk>
Fri, 6 Feb 2004 23:59:57 +0000 (23:59 +0000)
committerKim F. Storm <storm@cua.dk>
Fri, 6 Feb 2004 23:59:57 +0000 (23:59 +0000)
window when jumping to end of line (rather than centering cursor).

src/xdisp.c

index 3241822e7b495da76e1c301b7c339ef1530815d0..5186a8641c35750fbf1f9f067bec46a84861053f 100644 (file)
@@ -9562,7 +9562,10 @@ hscroll_window_tree (window)
 
              /* Position cursor in window.  */
              if (!hscroll_relative_p && hscroll_step_abs == 0)
-               hscroll = max (0, it.current_x - text_area_width / 2)
+               hscroll = max (0, (it.current_x
+                                  - (ITERATOR_AT_END_OF_LINE_P (&it)
+                                     ? (text_area_width - 4 * FRAME_COLUMN_WIDTH (it.f))
+                                     : (text_area_width / 2))))
                          / FRAME_COLUMN_WIDTH (it.f);
              else if (w->cursor.x >= text_area_width - h_margin)
                {